package com.bwie.utils;

import lombok.Data;

/**
 * @author : LeiMingkun
 * @date : 2024-09-09 09:09
 * @description : R
 **/
@Data
public class R {
    private Integer code;
    private Object data;
    private Boolean flag;
    public static R success(){
        R r = new R();
        r.setCode(200);
        r.setFlag(true);
        return r;
    }
    public static R success(Object data){
        R r = new R();
        r.setData(data);
        r.setCode(200);
        r.setFlag(true);
        return r;
    }
    public static R error(){
        R r = new R();
        r.setFlag(false);
        r.setCode(500);
        return r;
    }
    public static R error(Object data){
        R r = new R();
        r.setData(data);
        r.setFlag(false);
        r.setCode(500);
        return r;
    }
}